package common.extensions;

/**
 * An aggregator function from (S X T) -> S
 * 
 * @author Gal Lalouche
 * @param <S> The result type
 * @param <T> The iterable type
 */
public interface Aggregator<S, T> {
	/**
	 * Aggeragates the new value
	 * 
	 * @param currentValue The current value
	 * @param nextValue The value to add to the current value
	 * @return currentValue OP nextValu
	 */
	S calculate(S currentValue, T nextValue);
}
